home *** CD-ROM | disk | FTP | other *** search
- global gPFimportedData, gPFname, gCurrentList, gNoteData, glCurrentListData, gImageLibNum, gImageDescription, glSelectedLabels, glSelectedLines, glPFListNames, gAction, glListImageNames, glImageList, gRenameListName, gCurrentScreen, gNewList, gListObject, PFList, gremovefromlistnotlviewswitch
-
- on DoAction
- case gAction of
- #CloseNotesWindow:
- window("notes").moveToBack()
- window("notes").close()
- window("Notes").forget()
- gAction = EMPTY
- #CloseHelpWindow:
- window("Help").moveToBack()
- window("Help").close()
- window("Help").forget()
- gAction = EMPTY
- #AddImageToList:
- CreateImageDefinition()
- CheckForValidImageData()
- AddToList()
- UpdatePersonalFileData()
- WritePersonalFileNoDialog()
- #AddUnEditedImageToList:
- CreateBasicImageDefinition()
- CheckForValidImageData()
- UpdateListData(#add)
- UpdatePersonalFileData()
- WritePersonalFileNoDialog()
- #RemoveFromList:
- CreateImageDefinition()
- CheckForValidImageData()
- RemoveImageFromList()
- UpdatePersonalFileData()
- WritePersonalFileNoDialog()
- #RemoveFromListView:
- RemoveImagePositionFromList()
- UpdatePersonalFileData()
- WritePersonalFileNoDialog()
- #LoadListData:
- ReadListData()
- #LoadListDataDisplay:
- LoadAndDisplayThumbnails()
- HideSelection()
- #UpdateImageInList:
- CreateImageDefinition()
- CheckForValidImageData()
- UpdateListData(#update)
- UpdatePersonalFileData()
- WritePersonalFileNoDialog()
- #DeleteList:
- DeleteAList()
- ClearListVars()
- EraseThumbnails()
- WritePersonalFileNoDialog()
- #RenameList:
- setUpResponseDialog()
- runResponseDialog()
- RenameAList()
- UpdatePersonalFileData()
- WritePersonalFileNoDialog()
- #AbortAction:
- abort()
- end case
- end
-
- on AddToList
- if gPFimportedData = EMPTY then
- gPFimportedData = glPFListNames & RETURN & "~" & gCurrentList & RETURN & value(gListObject).plImageData & RETURN & "~"
- glPFListNames = list(gCurrentList)
- glListImageNames = list(value(gListObject).pCurrentImage)
- end if
- UpdateListData(#add)
- end
-
- on UpdateListData Option
- if Option = #add then
- append(glCurrentListData, value(gListObject).plImageData)
- append(PFList.plFoundImages, value(gListObject).pCurrentImage)
- PFList.pImageListPosition = glCurrentListData.count
- PFList.pCurrentImage = value(gListObject).pCurrentImage
- else
- deleteAt(glCurrentListData, PFList.pImageListPosition)
- addAt(glCurrentListData, PFList.pImageListPosition, value(gListObject).plImageData)
- end if
- end
-
- on UpdatePersonalFileData
- delete gPFimportedData.line[1]
- put glPFListNames & RETURN before gPFimportedData
- EraseListData()
- delete gPFimportedData.line[gPFimportedData.line.count]
- put RETURN & "~" & gCurrentList after gPFimportedData
- repeat with plateNum = 1 to glCurrentListData.count
- put RETURN & string(getAt(glCurrentListData, plateNum)) after gPFimportedData
- end repeat
- put RETURN & "~" after gPFimportedData
- end
-
- on ReadListData
- repeat with lineNum = 1 to gPFimportedData.line.count
- if gPFimportedData.line[lineNum].char[1] = "~" then
- lineContent = gPFimportedData.line[lineNum]
- if lineContent.char[2..lineContent.char.count] = gCurrentList then
- platecount = 0
- repeat while gPFimportedData.line[lineNum + platecount + 1].char[1] <> "~"
- if gPFimportedData.line[lineNum + platecount + 1] = "[:]" then
- exit repeat
- end if
- platecount = platecount + 1
- end repeat
- value(gListObject).plFoundImages = []
- glListImageNames = []
- glCurrentListData = []
- repeat with plateNum = lineNum + 1 to lineNum + platecount
- plateData = value(gPFimportedData.line[plateNum])
- if plateData = [:] then
- exit repeat
- end if
- append(glCurrentListData, plateData)
- append(glListImageNames, getPropAt(plateData, 1))
- end repeat
- repeat with nameNum = 1 to glListImageNames.count
- imageName = getAt(glListImageNames, nameNum)
- imageNumber = imageName.char[6..imageName.char.count]
- if gCurrentScreen = "PFlist" then
- if getOne(glImageList, imageNumber) <> 0 then
- append(value(gListObject).plFoundImages, imageNumber)
- end if
- end if
- end repeat
- end if
- end if
- end repeat
- end
-
- on EraseListData
- repeat with lineNum = 1 to gPFimportedData.line.count
- if gPFimportedData.line[lineNum].char[1] = "~" then
- lineContent = gPFimportedData.line[lineNum]
- if lineContent.char[2..lineContent.char.count] = gCurrentList then
- platecount = 0
- repeat while gPFimportedData.line[lineNum + platecount + 1].char[1] <> "~"
- if gPFimportedData.line[lineNum + platecount + 1] = "[:]" then
- exit repeat
- end if
- platecount = platecount + 1
- end repeat
- repeat with oldPlateNum = lineNum + platecount down to lineNum
- delete line oldPlateNum of gPFimportedData
- end repeat
- end if
- end if
- end repeat
- end
-
- on ClearListVars
- glCurrentListData = []
- gCurrentList = EMPTY
- value(gListObject).pCurrentImage = EMPTY
- value(gListObject).plFoundImages = []
- value(gListObject).plFoundImages = []
- value(gListObject).pltnnumberlist = []
- gllistimages = []
- glListImageNames = []
- end
-
- on RemoveImageFromList
- if getPos(glCurrentListData, value(gListObject).plImageData) > 0 then
- if gListObject = "PFList" then
- PFList.pImageListPosition = value(gListObject).pImageListPosition
- else
- PFList.pImageListPosition = getPos(glCurrentListData, value(gListObject).plImageData)
- end if
- deleteAt(glCurrentListData, PFList.pImageListPosition)
- PFList.plFoundImages = []
- repeat with x = 1 to glCurrentListData.count
- append(PFList.plFoundImages, getAt(getAt(getAt(glCurrentListData, x), 1), 1))
- end repeat
- if PFList.pImageListPosition > 1 then
- PFList.pImageListPosition = PFList.pImageListPosition - 1
- value(gListObject).plImageData = getAt(glCurrentListData, PFList.pImageListPosition)
- if gremovefromlistnotlviewswitch then
- exit
- end if
- LoadImageDefinition()
- RestoreImage()
- else
- PFList.pImageListPosition = 0
- if gremovefromlistnotlviewswitch then
- exit
- end if
- ClearImageDefinition()
- LoadImage(EMPTY)
- end if
- else
- alert("This image has either been altered or has not been saved to the current list.")
- abort()
- end if
- end
-
- on RemoveImagePositionFromList
- deleteAt(glCurrentListData, PFList.pImageListPosition)
- deleteAt(PFList.plFoundImages, PFList.pImageListPosition)
- if PFList.pImageListPosition > 1 then
- PFList.pImageListPosition = PFList.pImageListPosition - 1
- else
- PFList.pImageListPosition = 1
- end if
- if glCurrentListData <> [] then
- PFList.plImageData = getAt(glCurrentListData, PFList.pImageListPosition)
- LoadImageDefinition()
- end if
- value(gListObject).plImageData = [:]
- gImageDescription = EMPTY
- value(gListObject).pCurrentImage = EMPTY
- value(gListObject).pCurrentImageTitle = EMPTY
- value(gListObject).pSelectedImageSpriteNum = 0
- member("status").text = EMPTY
- member("description").text = EMPTY
- HideSelection()
- DisplayThumbsAfterDeletion()
- end
-
- on DeleteAList
- deleteOne(glPFListNames, gCurrentList)
- delete gPFimportedData.line[1]
- put glPFListNames & RETURN before gPFimportedData
- repeat with lineNum = 1 to gPFimportedData.line.count
- if gPFimportedData.line[lineNum].char[1] = "~" then
- lineContent = gPFimportedData.line[lineNum]
- if lineContent.char[2..lineContent.char.count] = gCurrentList then
- platecount = 0
- repeat while gPFimportedData.line[lineNum + platecount + 1].char[1] <> "~"
- if gPFimportedData.line[lineNum + platecount + 1] = "[:]" then
- exit repeat
- end if
- platecount = platecount + 1
- end repeat
- repeat with oldPlateNum = lineNum + platecount down to lineNum
- delete line oldPlateNum of gPFimportedData
- end repeat
- end if
- end if
- end repeat
- if glPFListNames.count = 0 then
- append(glPFListNames, "list1")
- gCurrentList = "list1"
- gPFimportedData = "[" & QUOTE & "list1" & QUOTE & "]" & RETURN & "~list1" & RETURN & "~"
- value(gListObject).plImageData = [:]
- glCurrentListData = []
- value(gListObject).pCurrentImage = EMPTY
- end if
- end
-
- on RenameAList
- deleteOne(glPFListNames, gCurrentList)
- append(glPFListNames, gRenameListName)
- repeat with lineNum = 1 to gPFimportedData.line.count
- if gPFimportedData.line[lineNum].char[1] = "~" then
- lineContent = gPFimportedData.line[lineNum]
- if lineContent.char[2..lineContent.char.count] = gCurrentList then
- put "~" & gRenameListName into line lineNum of gPFimportedData
- end if
- end if
- end repeat
- gCurrentList = gRenameListName
- end
-
- on AddAlist
- if getOne(glPFListNames, gNewList) = 0 then
- append(glPFListNames, gNewList)
- delete gPFimportedData.line[1]
- put glPFListNames & RETURN before gPFimportedData
- put gNewList & RETURN & "~" after gPFimportedData
- else
- alert("That name is already in use. Please select another.")
- abort()
- end if
- end
-
- on LoadAndDisplayThumbnails
- if not (gPFimportedData = EMPTY) then
- ReadListData()
- end if
- DisplayThumbNails()
- UpdateImageScroller()
- end
-
- on DisplayThumbsAfterDeletion
- PFList.pImageScroll = 1
- DisplayThumbNails()
- UpdateImageScroller()
- end
-